{% include "rpgEngine/head.html" %}
<div id="primarycontent">
	<div align="center">
	<form id="formAddGame" action="/gameList/" method="post">
		<table style="border:0px;">
		<tr><td style="text-align:right;">{{ form.name.label_tag }} :</td><td colspan="3">{{ form.name }}</td>
		</tr>
		<tr><td style="text-align:right;">{{ form.username.label_tag }} :</td><td>{{ form.username }}</td>
		    <td style="text-align:right;">{{ form.password.label_tag }} :</td><td>{{ form.password }}</td>
		</tr>
		<tr><td style="text-align:right;">{{ form.firstname.label_tag }} :</td><td>{{ form.firstname }}</td>
		    <td style="text-align:right;">{{ form.lastname.label_tag }} :</td><td>{{ form.lastname }}</td></tr>
		<tr><td colspan="4" style="text-align:right;"><input type="submit" id="addGame" name="addGame" value="Create Game" alt="Create a Game" /></td></tr>
		</table>
	</form>
	{% if isError %}
		<p id="errorMessage">please fill up all fields</p>
	{% endif %}
	{% if isError_username_alreay_exist %}
		<p id="errorMessage">this username already exist, choose another one</p>
	{% endif %}
	{% if isError_game_name_alreay_exist %}
		<p id="errorMessage">this game name already exist, choose another one</p>
	{% endif %}
	<br/>
	</div>

	{% for name, username, first_n, last_n in games %}
	<div class="game">
		<div class="content">
		<p><h2>{{name}}</h2></p>
		<p style="position:relative; left:20px;"><span><strong><big>{{first_n}} {{last_n}}</strong></big></span> - <span>username : {{username}}</span></p>
		</div>			
	</div>
	{% endfor %}

</div>
{% include "rpgEngine/foot.html" %}
